/***********************************************************************
 * 描述:		文件相关信息
 * File:    fileinfo.h
 * Author:  liquan@mozihealthcare.cn
 * Date:    2025-10-13
 * Update:
 **********************************************************************/

#ifndef FILEINFO_H
#define FILEINFO_H

#include <common/serialization.h>

struct FileInfo
{
	QString id;
	QString logicPath;
	QString fileName;
	long fileSize;
	QString filePath;
	QString group;
	QString groupName;
	QString fileType;
	QString storageType;
	QString uploadType;
	QString createDate;
	QString updateDate;
	QString fileFullPath;
	int duration;
	QString className;
	QString smallPicPath;
	QString smallPicFullPath;
	QString aeTitle;
	QString patientid;
	QString accessionNumber;
	QString seriesInstanceUid;
	QString firstFramePath;
	QString firstFrameFullPath;
	QString remark;
	QString md5;
	QString dirId;

	bool isEmpty() const
	{
		return id.isEmpty();
	};
};

RAPIDJSON_ADAPT_STRUCT(FileInfo,
					   "id", &FileInfo::id,
					   "logicPath", &FileInfo::logicPath,
					   "fileName", &FileInfo::fileName,
					   "fileSize", &FileInfo::fileSize,
					   "filePath", &FileInfo::filePath,
					   "group", &FileInfo::group,
					   "groupName", &FileInfo::groupName,
					   "fileType", &FileInfo::fileType,
					   "storageType", &FileInfo::storageType,
					   "uploadType", &FileInfo::uploadType,
					   "createDate", &FileInfo::createDate,
					   "updateDate", &FileInfo::updateDate,
					   "fileFullPath", &FileInfo::fileFullPath,
					   "duration", &FileInfo::duration,
					   "className", &FileInfo::className,
					   "smallPicPath", &FileInfo::smallPicPath,
					   "smallPicFullPath", &FileInfo::smallPicFullPath,
					   "aeTitle", &FileInfo::aeTitle,
					   "patientid", &FileInfo::patientid,
					   "accessionNumber", &FileInfo::accessionNumber,
					   "seriesInstanceUid", &FileInfo::seriesInstanceUid,
					   "firstFramePath", &FileInfo::firstFramePath,
					   "firstFrameFullPath", &FileInfo::firstFrameFullPath,
					   "remark", &FileInfo::remark,
					   "md5", &FileInfo::md5,
					   "dirId", &FileInfo::dirId)

BEGIN_DESERIALIZE_ADAPTER(FileInfo)
DESERIALIZE_FIELD(id)
DESERIALIZE_FIELD(logicPath)
DESERIALIZE_FIELD(fileName)
DESERIALIZE_FIELD(fileSize)
DESERIALIZE_FIELD(filePath)
DESERIALIZE_FIELD(group)
DESERIALIZE_FIELD(groupName)
DESERIALIZE_FIELD(fileType)
DESERIALIZE_FIELD(storageType)
DESERIALIZE_FIELD(uploadType)
DESERIALIZE_FIELD(createDate)
DESERIALIZE_FIELD(updateDate)
DESERIALIZE_FIELD(fileFullPath)
DESERIALIZE_FIELD(duration)
DESERIALIZE_FIELD(className)
DESERIALIZE_FIELD(smallPicPath)
DESERIALIZE_FIELD(smallPicFullPath)
DESERIALIZE_FIELD(aeTitle)
DESERIALIZE_FIELD(patientid)
DESERIALIZE_FIELD(accessionNumber)
DESERIALIZE_FIELD(seriesInstanceUid)
DESERIALIZE_FIELD(firstFramePath)
DESERIALIZE_FIELD(firstFrameFullPath)
DESERIALIZE_FIELD(remark)
DESERIALIZE_FIELD(md5)
DESERIALIZE_FIELD(dirId)
END_DESERIALIZE_ADAPTER()

#endif//FILEINFO_H
